extends Control
@onready var cont :int = 1

func load_game(go :bool):
	if go :
		$loadingmap/Tim.start(0.5)
		$Timer.start(5)
		

func _on_tim_timeout():
	cont = (cont + 1) % 4
	match cont:
		0: $loadingmap/Label.text = "加载游戏中."
		1: $loadingmap/Label.text = "加载游戏中.."
		2: $loadingmap/Label.text = "加载游戏中..."
		3: $loadingmap/Label.text = "加载游戏中...."


func _on_timer_timeout():
	var tweer = create_tween()
	tweer.tween_property($"." , "modulate:a" , 0 , 1)
	tweer.tween_callback($"."._visible)
	$"../ui".visible = true
	
func _visible():
	$".".visible = false
	$loadingmap/Tim.stop()
	queue_free()
